package com.hyg.www.carrenting.controller;

import com.hyg.www.carrenting.model.Users;
import com.hyg.www.carrenting.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户信息控制层
 * @Auther: hyg
 * @Date: 2018/11/27 11:19
 * @Description:
 */
@RestController
@RequestMapping(value = "/v1")
public class UserController {

    @Autowired
    private UserService userService;

    /**
     * 根据id获取用户信息
     * @param id
     * @return
     */
    @GetMapping(value = "/user/{id}")
    public Users getUser(@PathVariable(value = "id") String id){
        Users user = userService.getUserById(id);
        return user;
    }


}
